package com.qf.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.dao.HappyBeanHistoryDao;
import com.qf.entity.HappyBeanHistory;
import com.qf.service.HappyBeanHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/*欢乐豆流水记录 业务实现*/
@Service
public class HappyBeanHistoryServiceImpl implements HappyBeanHistoryService {
 @Autowired
 private HappyBeanHistoryDao happyBeanHistoryDao;
   /*新增欢乐豆流水记录*/
    @Override
    public int insertHistory(HappyBeanHistory happyBeanHistory) {
        return happyBeanHistoryDao.insert(happyBeanHistory);
    }
/*根据用户id查欢乐豆的流水记录列表*/
    @Override
    public List<HappyBeanHistory> queryHistoryByUid(Integer uid) {
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("u_id",uid);

        return    happyBeanHistoryDao.selectList(queryWrapper);

    }
}
